package com.jec.module.sysconfig.service.configor;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Component;

import com.jec.module.sysconfig.dao.ClockRepository;
import com.jec.module.sysconfig.entity.Clock;
import com.jec.module.sysconfig.service.convertor.ClockConvertor;
import com.jec.module.sysconfig.service.convertor.Convertor;

@Component
public class ClockConfigor extends BaseConfigor<Clock> {
	
	@Autowired
	private ClockRepository clockRepository;
	
	@Autowired 
	private ClockConvertor clockConvertor;
	
	public ClockConfigor() {
		logKey = "时钟";
	}
	
	@Override
	protected JpaRepository<Clock, Integer> getRepository() {
		return clockRepository;
	}
	
	@Override
	protected Convertor<Clock> getConvertor() {
		return clockConvertor;
	}

	@Override
	public boolean hasConfigOnNetunit(int netunit) {
		return !clockRepository.findAllByNetunit(netunit).isEmpty();
	}

}
